﻿using JESAI.Biz.Data.Enums;
using JESAI.DDD.Entities;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JESAI.Platform.Domain.Sys.Entities
{
    /// <summary>
    /// 数据源字段实体
    /// </summary>
    [SugarTable("mlt_sys_datasource_columns")]
    public class DataSourceColumnsEntity : IEntity<string>
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = false)]
        public string Id { get; set; }

        /// <summary>
        /// 字段
        /// </summary>
        public string Columns { get; set; }

        /// <summary>
        /// 字段描述
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 字段数据类型
        /// </summary>
        public DataSourceDataType DataType { get; set; }

        /// <summary>
        /// 数据长度
        /// </summary>
        public int? DataLength { get; set; }

        /// <summary>
        /// 字段可空
        /// </summary>
        public bool IsAllowNull { get; set; }

        /// <summary>
        /// 序号
        /// </summary>
        public int SortNum { get; set; }

        /// <summary>
        /// 表编码
        /// </summary>
        public string TableCode { get; set; }

        /// <summary>
        /// 是否有效
        /// </summary>
        public bool IsValid { get; set; }

        /// <summary>
        /// 表ID
        /// </summary>
        public string TableId { get; set; }

        /// <summary>
        /// 创建者ID
        /// </summary>
        public long Cid { get; set; }

        /// <summary>
        /// 更新者ID
        /// </summary>
        public long Uid { get; set; }

        /// <summary>
        /// 是否主键
        /// </summary>
        public bool IsPrimaryKey { get; set; }

        /// <summary>
        /// 是否唯一键
        /// </summary>
        public bool IsUniqueKey { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }
    }
}
